<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Persona</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Persona</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/models/persona_rb.html">
                app/models/persona.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                ActiveRecord::Base
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000026">es_alumno?</a>&nbsp;&nbsp;
      <a href="#M000030">es_prospect?</a>&nbsp;&nbsp;
      <a href="#M000032">es_vip?</a>&nbsp;&nbsp;
      <a href="#M000031">fin_plan</a>&nbsp;&nbsp;
      <a href="#M000027">find_alumnos</a>&nbsp;&nbsp;
      <a href="#M000028">find_exAlumnos</a>&nbsp;&nbsp;
      <a href="#M000029">find_prospects</a>&nbsp;&nbsp;
      <a href="#M000025">nombre_completo</a>&nbsp;&nbsp;
      <a href="#M000033">plan_vigente?</a>&nbsp;&nbsp;
      <a href="#M000038">preyoga</a>&nbsp;&nbsp;
      <a href="#M000034">ultima_gestion</a>&nbsp;&nbsp;
      <a href="#M000035">ultima_reunion</a>&nbsp;&nbsp;
      <a href="#M000036">ultima_revisacion</a>&nbsp;&nbsp;
      <a href="#M000037">yoga</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000026" class="method-detail">
        <a name="M000026"></a>

        <div class="method-heading">
          <a href="#M000026" class="method-signature">
          <span class="method-name">es_alumno?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve verdadero si la persona es alumno
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000026-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 33</span>
33:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">es_alumno?</span>
34:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">coeficiente_id</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">ALUMNO</span>
35:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000030" class="method-detail">
        <a name="M000030"></a>

        <div class="method-heading">
          <a href="#M000030" class="method-signature">
          <span class="method-name">es_prospect?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve verdadero si se trata de una VISITA P-, P o P+ ATENCION: para esta
funcion alumnos y exalumnos devuelven falso
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000030-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 54</span>
54:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">es_prospect?</span>
55:     <span class="ruby-keyword kw">return</span> ((<span class="ruby-identifier">coeficiente_id</span> <span class="ruby-operator">&gt;</span> <span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">FP</span>) <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">coeficiente_id</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">ALUMNO</span>))
56:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000032" class="method-detail">
        <a name="M000032"></a>

        <div class="method-heading">
          <a href="#M000032" class="method-signature">
          <span class="method-name">es_vip?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000032-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 69</span>
69:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">es_vip?</span>
70:     <span class="ruby-identifier">p</span> = <span class="ruby-identifier">plans</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:conditions=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'ini&lt;= NOW() AND fin&gt;=NOW()'</span>, <span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'fin DESC'</span>)
71:     <span class="ruby-keyword kw">return</span> ((<span class="ruby-identifier">p</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">vip</span>)
72:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000031" class="method-detail">
        <a name="M000031"></a>

        <div class="method-heading">
          <a href="#M000031" class="method-signature">
          <span class="method-name">fin_plan</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve la fecha de fin de plan mas lejana, es decir del ultimo plan nulo
si no hay planes
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000031-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 60</span>
60:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fin_plan</span>
61:     <span class="ruby-ivar">@ret</span> = <span class="ruby-identifier">plans</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'fin DESC'</span>)
62:     <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@ret</span> <span class="ruby-keyword kw">then</span>
63:       <span class="ruby-ivar">@ret</span> = <span class="ruby-ivar">@ret</span>.<span class="ruby-identifier">fin</span>
64:     <span class="ruby-keyword kw">end</span>
65:     <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ret</span>
66:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000027" class="method-detail">
        <a name="M000027"></a>

        <div class="method-heading">
          <a href="#M000027" class="method-signature">
          <span class="method-name">find_alumnos</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
FIXME no me lo toma
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000027-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 38</span>
38:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_alumnos</span>
39:     <span class="ruby-constant">Persona</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'coeficiente_id='</span>,<span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">ALUMNO</span>].<span class="ruby-identifier">join</span>)   
40:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000028" class="method-detail">
        <a name="M000028"></a>

        <div class="method-heading">
          <a href="#M000028" class="method-signature">
          <span class="method-name">find_exAlumnos</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
FIXME no me lo toma
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000028-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 43</span>
43:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_exAlumnos</span>
44:     <span class="ruby-constant">Persona</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions=</span><span class="ruby-operator">&gt;</span>[<span class="ruby-value str">'coeficiente_id='</span>,<span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">EXALUMNO</span>].<span class="ruby-identifier">join</span>)   
45:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000029" class="method-detail">
        <a name="M000029"></a>

        <div class="method-heading">
          <a href="#M000029" class="method-signature">
          <span class="method-name">find_prospects</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
FIXME no me lo toma
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000029-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 48</span>
48:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_prospects</span>
49:     <span class="ruby-constant">Persona</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions=</span><span class="ruby-operator">&gt;</span><span class="ruby-node">&quot;coeficiente_id&gt;#{Coeficiente::FP} AND coeficiente_id&lt;#{Coeficiente::ALUMNO}&quot;</span>)   
50:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000025" class="method-detail">
        <a name="M000025"></a>

        <div class="method-heading">
          <a href="#M000025" class="method-signature">
          <span class="method-name">nombre_completo</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000025-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 28</span>
28:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nombre_completo</span>
29:     <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{nombres} #{apellidos}&quot;</span>
30:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000033" class="method-detail">
        <a name="M000033"></a>

        <div class="method-heading">
          <a href="#M000033" class="method-signature">
          <span class="method-name">plan_vigente?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve true si la persona tiene un plan vigente considera el MES no la
fecha exacta devuelve false si no tiene plan vigente, o no es alumno
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000033-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 77</span>
77:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plan_vigente?</span>
78:     <span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">coeficiente_id</span>=<span class="ruby-constant">Coeficiente</span><span class="ruby-operator">::</span><span class="ruby-constant">ALUMNO</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">plans</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'month(ini)&lt;= month(NOW()) AND month(fin)&gt;=month(NOW())'</span>).<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>))
79:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000038" class="method-detail">
        <a name="M000038"></a>

        <div class="method-heading">
          <a href="#M000038" class="method-signature">
          <span class="method-name">preyoga</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve verdadero si es alumno de <a
href="Persona.html#M000038">preyoga</a>
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000038-source">
<pre>
     <span class="ruby-comment cmt"># File app/models/persona.rb, line 123</span>
123:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">preyoga</span>
124:     <span class="ruby-comment cmt"># podria chequear si el alumno es vip o no.</span>
125:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">grado</span>=<span class="ruby-value">5</span>
126:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000034" class="method-detail">
        <a name="M000034"></a>

        <div class="method-heading">
          <a href="#M000034" class="method-signature">
          <span class="method-name">ultima_gestion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve la ultima gestions evolutiva (orden cronologico) si no hay
devuelve -
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000034-source">
<pre>
    <span class="ruby-comment cmt"># File app/models/persona.rb, line 83</span>
83:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ultima_gestion</span>
84:     <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@aux</span> = <span class="ruby-identifier">gestions</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'fecha DESC'</span>) <span class="ruby-keyword kw">then</span>
85:       <span class="ruby-ivar">@ret</span> = <span class="ruby-ivar">@aux</span>.<span class="ruby-identifier">fecha</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%d/%b/%Y&quot;</span>)
86:     <span class="ruby-keyword kw">else</span>
87:       <span class="ruby-ivar">@ret</span> = <span class="ruby-value str">'-'</span>
88:     <span class="ruby-keyword kw">end</span>
89:     
90:     <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ret</span>
91:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000035" class="method-detail">
        <a name="M000035"></a>

        <div class="method-heading">
          <a href="#M000035" class="method-signature">
          <span class="method-name">ultima_reunion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve la ultima reunion con el director(orden cronologico) si no hay
devuelve -
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000035-source">
<pre>
     <span class="ruby-comment cmt"># File app/models/persona.rb, line 95</span>
 95:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ultima_reunion</span>
 96:     <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@aux</span> = <span class="ruby-identifier">reunions</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'fecha DESC'</span>) <span class="ruby-keyword kw">then</span>
 97:       <span class="ruby-ivar">@ret</span> = <span class="ruby-ivar">@aux</span>.<span class="ruby-identifier">fecha</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%d/%b/%Y&quot;</span>)
 98:     <span class="ruby-keyword kw">else</span>
 99:       <span class="ruby-ivar">@ret</span> = <span class="ruby-value str">'-'</span>
100:     <span class="ruby-keyword kw">end</span>
101:     
102:     <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ret</span>
103:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000036" class="method-detail">
        <a name="M000036"></a>

        <div class="method-heading">
          <a href="#M000036" class="method-signature">
          <span class="method-name">ultima_revisacion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve la ultima revisacion medica (orden cronologico) si no hay devuelve
-
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000036-source">
<pre>
     <span class="ruby-comment cmt"># File app/models/persona.rb, line 107</span>
107:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ultima_revisacion</span>
108:     <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@aux</span> = <span class="ruby-identifier">revisacions</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>, <span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'fecha DESC'</span>) <span class="ruby-keyword kw">then</span>
109:       <span class="ruby-ivar">@ret</span> = <span class="ruby-ivar">@aux</span>.<span class="ruby-identifier">fecha</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%d/%b/%Y&quot;</span>)
110:     <span class="ruby-keyword kw">else</span>
111:       <span class="ruby-ivar">@ret</span> = <span class="ruby-value str">'-'</span>
112:     <span class="ruby-keyword kw">end</span>
113:     
114:     <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ret</span>
115:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000037" class="method-detail">
        <a name="M000037"></a>

        <div class="method-heading">
          <a href="#M000037" class="method-signature">
          <span class="method-name">yoga</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
devuelve verdadero si es alumno de <a href="Persona.html#M000037">yoga</a>
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000037-source">
<pre>
     <span class="ruby-comment cmt"># File app/models/persona.rb, line 118</span>
118:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">yoga</span>
119:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">grado</span><span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>
120:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>